USE [HomestayWebDB]
GO
/****** Object:  StoredProcedure [dbo].[Store_HomeStayType_GetNameHomeStayType]    Script Date: 12/12/2012 12:27:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[Store_HomeStayType_GetNameHomeStayType]
	@HouseID int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	SELECT  ht.HomeStayTypeID,ht.Name as HomeStayTypeName
	FROM Posts p, Houses h,Tourisms t, HomeStayTypes ht
	WHERE p.HouseID = h.HouseID AND p.PostID = @HouseID AND h.HouseID = t.HouseID AND t.HomeStayTypeID  = ht.HomeStayTypeID AND
		 h.IsDeleted = 'False' AND h.IsDeleted = 'False' AND p.IsDeleted ='false'
END
